function getUrlVars() {
    var vars = {};
    var parts = window.location.href.replace(/[?&]+([^=&]+)=([^&]*)/gi, function(m,key,value) {
        vars[key] = value;
    });
    return vars;
}
    
$(document).ready(function(){
    var apiKey = 'd8ed58348bb7d25a8aaf8676ede4afb2';
    var id= getUrlVars()['id'];
    $.getJSON('http://api.flickr.com/services/rest/?method=flickr.photos.getInfo&api_key=' + apiKey + '&photo_id='+id+'&format=json&jsoncallback=?',
        function(data, status){
            
            $('body').append('<div id="content">');      
            $('#content').append('<div id="image">');                 
                    
            $.getJSON('http://api.flickr.com/services/rest/?method=flickr.photos.getSizes&api_key='+apiKey+'&photo_id='+id+'&format=json&jsoncallback=?',
                function(sizes, status){
                    $('#image').append('<img src="'+sizes.sizes.size[3].source+'"/>'); 
                    $('#content').append('<div id="descripcion"/>');
                    $('#descripcion').append('<p>'+data.photo.description._content+'</p>');
                });  
        });     
});